import { reqCategoryData } from '../api/category'
Page({
    data: {
        category: [],
        activeIndex: 0
    },
    async getCategory() {
        const res = await reqCategoryData()
        this.setData({
            category: res.data
        })
    },
    changeIndex(event) {
        const { index } = event.currentTarget.dataset
        this.setData({
            activeIndex: index
        })
    },
    onLoad() {
        this.getCategory()
    }

})
